<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>

<!DOCTYPE html>
<html>
<head>
<!-- Standard Meta -->
<c:import url="../common/meda.jsp"></c:import>

<!-- Site Properties -->
<title>个人中心-高考志愿通</title>
<link rel="stylesheet" type="text/css"
	href="//${static_server }/css/semantic.css">
<link rel="stylesheet" type="text/css"
	href="//${static_server }/css/common.css">

<script src="//${static_server }/js/jquery.min.js"></script>
<script src="//${static_server }/js/semantic.js"></script>
<script src="//${static_server }/js/common.js"></script>
<script src="//${static_server }/js/title_menu.js"></script>
<script src="//${static_server }/js/sys.js"></script>

</head>
<body class="pushable">
	<c:import url="../common/title_menu.jsp"></c:import>
	<div class="pusher">
		<div id="infobodysegment" class="ui vertical masthead segment">
			<div class="ui container">
				<div
					class='ui success message <c:if test="${empty msg}">hidden</c:if>'>${msg }</div>

				<div class="ui top attached tabular menu">
					<a class="item active" data-tab="first">激活码查询</a><a class="item"
						data-tab="second">生成激活码</a>
				</div>

				<div class="ui bottom attached active tab segment" data-tab="first">
					<form class="ui query code form" action="/sys/queryCode.do" method="post">
						<div class="ui tiny dividing header">
							功能导读<i class="orange help inline circle icon"
								data-content="激活码查询，可以查询自己生辰的激活码！" data-variation="wide"></i>
						</div>
						<div class="two fields">
							<div class="field">
								<label>渠道标示</label>
								<div class="ui fluid search selection dropdown">
									<input name="q_channel" type="hidden" value=""> <i
										class="dropdown icon"></i>
									<div class="default text">渠道标示</div>
									<div class="fluid menu">
										<c:forEach var="item" items="${channels }">
											<div class="item" data-value="${item }">${item }</div>
										</c:forEach>
									</div>
								</div>
							</div>
							<div class="field">
								<label>激活码状态</label> <select name="q_status">
									<option selected value="0">未使用</option>
									<option value="1">已失效</option>
									<option value="2">已激活</option>
									<option value="3">已过期</option>
									<option value="4">已售卖</option>
								</select>
							</div>
						</div>
						<div class="two fields">
							<div class="field">
								<label>激活角色</label>
								<div class="ui fluid selection dropdown">
									<input name="q_role" type="hidden" value=""> <i
										class="dropdown icon"></i>
									<div class="default text">激活角色</div>
									<div class="fluid menu">
										<div class="item" data-value="2">VIP学生角色</div>
									</div>
								</div>
							</div>
							<div class="field"></div>
						</div>
						<div class="ui orange submit button">查询</div>
						<div class="ui error message"></div>
					</form>
					<table class="ui unstackable attached celled  table">
						<tfoot class="full-width">
							<tr>
								<th colspan="12">
									<div class="ui right floated small labeled icon button">
										<i class="download icon"></i> 导出
									</div>
								</th>
							</tr>
						</tfoot>
						<thead>
							<tr>
								<th>激活码</th>
								<th>角色id</th>
								<th>渠道标示</th>
								<th>状态</th>
								<th>激活用户</th>
								<th>激活时间</th>
								<th>购买用户</th>
								<th>购买时间</th>
								<th>购买金额</th>
								<th>过期时间</th>
								<th>生成时间</th>
								<th>操作用户</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="item" items="${codes }">
								<tr>
									<td>${item.id }</td>
									<td>${item.role }</td>
									<td>${item.channel }</td>
									<td>${item.status }</td>
									<td>${item.userEmail }</td>
									<td>${item.activeDate }</td>
									<td>${item.buyEmail }</td>
									<td>${item.buyDate }</td>
									<td>${item.buyMoney }</td>
									<td>${item.expiredDate }</td>
									<td>${item.createdDate }</td>
									<td>${item.createdEmail }</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>

				<div class="ui bottom attached tab segment" data-tab="second">
					<form class="ui create code form " action="/sys/createCode.do"
						method="post">
						<div class="ui tiny dividing header">
							功能导读<i class="orange help inline circle icon"
								data-content="激活码生成该功能涉及费用以及后期统计，使用前请注意！" data-variation="wide"></i>
						</div>
						<div class="two fields">
							<div class="field">
								<label>渠道标示</label>
								<!-- channel_dropdown_c -->
								<div class="ui fluid search selection dropdown">
									<input name="c_channel" type="hidden" value=""> <i
										class="dropdown icon"></i>
									<div class="default text">渠道标示</div>
									<div class="fluid menu">
										<c:forEach var="item" items="${channels }">
											<div class="item" data-value="${item }">${item }</div>
										</c:forEach>
									</div>
								</div>
							</div>
							<div class="field">
								<label>激活角色</label>
								<div id="role_dropdown_c" class="ui fluid selection dropdown">
									<input name="c_role" type="hidden" value=""> <i
										class="dropdown icon"></i>
									<div class="default text">激活角色</div>
									<div class="fluid menu">
										<div class="item" data-value="2">VIP学生角色</div>
									</div>
								</div>
							</div>
						</div>
						<div class="two fields">
							<div class="field">
								<label>生成数量</label> <input placeholder="最大100张" name="c_num"
									type="number" value="1">
							</div>
							<div class="field"></div>
						</div>
						<div class="ui orange submit button">生成</div>
						<div class="ui error message"></div>
					</form>

					<table class="ui unstackable attached celled  table">
						<tfoot class="full-width">
							<tr>
								<th colspan="7">
									<div class="ui right floated small labeled icon button">
										<i class="download icon"></i> 导出
									</div>
								</th>
							</tr>
						</tfoot>
						<thead>
							<tr>
								<th>激活码</th>
								<th>角色id</th>
								<th>渠道标示</th>
								<th>状态</th>
								<th>过期时间</th>
								<th>生成时间</th>
								<th>操作用户</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="item" items="${codes }">
								<tr>
									<td>${item.id }</td>
									<td>${item.role }</td>
									<td>${item.channel }</td>
									<td>${item.status }</td>
									<td>${item.expiredDate }</td>
									<td>${item.createdDate }</td>
									<td>${item.createdEmail }</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
			<!-- content container end -->
		</div>
		<!-- schoolbodycontainer end -->
		<c:import url="../common/footer.jsp"></c:import>
	</div>
	<!-- pusher end -->
</body>
</html>